//
//  PTCamera.swift
//  PTWatch Watch App
//
//  Created by sc-chen on 2023/9/20.
//

import SwiftUI

struct PTCamera: View {
    @State private var isShowingHUD = false
    @State private var detailTxt = "不支持开发功能"
    
    var body: some View {
        /*ZStack {
            VStack {
                Button {
                    showHud()
                } label: {
                    Text("拍照")
                        .foregroundColor(.white)
                        .frame(maxWidth: .infinity,maxHeight: 40)
                        .background(
                            RoundedRectangle(cornerRadius: 5)
                                .fill(Color.blue)
                        )
                }
                .buttonStyle(.plain)
                .padding()
                
                Button {
                    showHud()
                } label: {
                    Text("录像")
                        .foregroundColor(.white)
                        .frame(maxWidth: .infinity,maxHeight: 40)
                        .background(
                            RoundedRectangle(cornerRadius: 5)
                                .fill(Color.blue)
                        )
                }
                .buttonStyle(.plain)
                .padding()
            }
            PTProgressHud(isPresented: $isShowingHUD, text: $detailTxt)
        }*/
        
        Text("不支持拍照/摄像的开发功能")
    }
    
    private func showHud() {
        isShowingHUD = true
        DispatchQueue.main.asyncAfter(deadline: .now()+2){
            isShowingHUD = false
        }
    }
}

struct PTCamera_Previews: PreviewProvider {
    static var previews: some View {
        PTCamera()
    }
}
